import org.junit.Test;

import java.util.regex.Pattern;

/**
 * Created by Z-C-Y on 2018-03-04.
 */
public class Demo {

    @Test
    public void aa(){
        long number = 11111111111L;
        boolean aa= Demo.checkNumberWithRegex(number);
        System.out.println(aa);


    }
    public static boolean checkNumberWithRegex(long num){
        String numStr = String.valueOf(num);

        String pattern = "^1[\\d]{10}";

        boolean isMatch = Pattern.matches(pattern, numStr);

        return isMatch;
    }
}
